<template>
<div>
  <home-head :name="person.personName"></home-head>
  <check-quotation v-on:btn="checkQuotation"></check-quotation>
  <post-quotation v-on:btn="postquotation"></post-quotation>
</div>
</template>

<script>

import HomeHead from "../../components/homeHead";
import postQuotation from "../../components/postQuotation";
import CheckQuotation from "../../components/checkQuotation";
import {request} from "../../network/request";
export default {
  name: "postHome",
  components: {
    CheckQuotation,
    HomeHead,
    postQuotation,
  },
  data(){
    return{
      person:{
        tid:this.$route.query.tid,
        capacity: this.$route.query.capacity,
        personName:this.$route.query. personName,
        telephone:this.$route.query.telephone,
        unitCompany: this.$route.query. unitCompany,
      },
      quos:[]
    }
  },
  methods:{
    postquotation: function(){
      this.$router.push({
        path:'/posttaskform'
      })
    },
    checkQuotation:function () {
      request({
        url:'/poster/listTaskFormByPid1',
        params:{
          pid1:this.person.tid,
        }
      }).then(result => {
        this.quos = result.data;
        console.log(result.data);
        this.$router.push({
          path:'/postquolist',
          query:{
            list:this.quos,
            person:this.person
          }
        })
      }).catch(err => {})
    }
  }
}
</script>

<style scoped>

</style>
